#include <iostream>

// 测试 strip --strip-unneeded 处理过的 sqlite 静态库是否还能用
#include <sqlite3.h>

int main()
{
	const char sql[] =
			"CREATE TABLE IF NOT EXISTS `requests` ("
					" `id` INTEGER PRIMARY KEY NOT NULL "
					", `code` INTEGER NOT NULL"
					", `content` TEXT NOT NULL"
					", `create_time` TIMESTAMP default (datetime('now', 'localtime')) NOT NULL"
					" );"
					"CREATE TABLE IF NOT EXISTS `alarm_no` ( `current` INTEGER );";

	int ret = 0;
	sqlite3 *db = NULL;
	try
	{
		ret = sqlite3_open("test.db", &db);
		if (ret != 0)
		{
			return false;
		}

		char *pszErr = NULL;
		ret = sqlite3_exec(db, sql, NULL, NULL, &pszErr);
		if (ret != SQLITE_OK)
		{
			sqlite3_free(pszErr);

			sqlite3_close(db);
			return false;
		}
	} catch (...)
	{
		ret = -1;
	}

	if (db != NULL)
		sqlite3_close(db);
	return 0;
}
